<template>
    <el-cascader
    v-model="value"
    :options="options"
    @change="handleChange"></el-cascader>
</template>
<script lang="ts">
import { Component, Vue, Prop, Provide, Watch } from "vue-property-decorator";
import commonApi from "@/api/common";
// import region from "../../../static/region.json";

@Component({
  components: {}
})
export default class supplierEditDialog extends Vue {
  // 属性或参数中使用 ！：表示强制解析（告诉typescript编译器，这里一定有值），常用于vue-decorator中的@Prop
  @Prop() address!: [];
  @Prop() form!: '';
  @Provide() options:any=[]
  @Provide() value:any=[]
  handleChange(value:any) {
    if(value.length<3){
      value[2]=0
    }
    this.$emit('bindSendAddress',value)//将图片路径传递给父组件
  }
  created() {
    commonApi.getRegion()
    .then(res=>{
      this.options=res.data
    })
    // this.options=region
    this.value=this.address
  }
}
</script>
